package com.css.zfzx.fwsjcj.modules.group.repository;

import com.css.zfzx.fwsjcj.commen.util.Constant;
import com.css.zfzx.fwsjcj.modules.group.entity.FwGroupEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;

@Repository
public interface FwGroupRepository extends JpaRepository<FwGroupEntity, String> {
  @Modifying
  @Query(nativeQuery = true,value = "update fw_group set del_flag ="+ Constant.IS_VALID_NO +",update_time =:updateTime where id in :ids")
  void  deletGroup(@Param("ids") List<String> ids,@Param("updateTime") Date updateTime);

  List<FwGroupEntity> findAllByGroupLeaderId(String groupLeaderID);
}
